import { Injectable } from '@angular/core';
import { HttpClientService } from '../../../services/http-client.service';
@Injectable()
export class OneEditService {

	constructor(
		public httpClient: HttpClientService
	) { }
	// 获取附件树
	getFileTree(getBody) {
		return this.httpClient.get('/pms/v1/common/fundFile/attachTree', getBody);
	}
	// 附件删除
	delFile(putBody) {
		return this.httpClient.put('/pms/v1/common/fundFile/file/' + putBody);
	}
	// 获取附件历史版本
	getFileHistory(getBody) {
		return this.httpClient.get('/pms/v1/common/fundFile/versions/' + getBody);
	}
	// 修改附件名
	changeFileName(nAttachNo, newFileName) {
		return this.httpClient.put('/pms/v1/common/fundFile/file?nAttachNo=' + nAttachNo + '&attachName=' + newFileName);
	}
	// 查询单个产品基础信息
	otoGetSingleProduct(nFundNo) {
		return this.httpClient.get('/pms/v1/oneOnOneFundInfo/basicInfo/' + nFundNo);
	}
	// 新增产品基础信息
	otoAddProduct(postBody) {
		return this.httpClient.post('/pms/v1/oneOnOneFundInfo/basicInfo', postBody);
	}
	// 编辑产品基础信息
	otoEditProduct(putBody) {
		delete putBody.sStatusZh;
		return this.httpClient.put('/pms/v1/oneOnOneFundInfo/basicInfo', putBody);
	}
	// 查询客户信息
	otoGetCustomer(nFundNo) {
		return this.httpClient.get('/pms/v1/oneOnOneFundInfo/customerInfo/' + nFundNo);
	}
	// 新增客户信息
	otoAddCustomer(postBody) {
		return this.httpClient.post('/pms/v1/oneOnOneFundInfo/customerInfo', postBody);
	}
	// 编辑客户信息
	otoEditCustomer(putBody) {
		return this.httpClient.put('/pms/v1/oneOnOneFundInfo/customerInfo', putBody);
	}
	// 投资经理信息
	otoGetManager(getBody) {
		return this.httpClient.get('/pms/1/common/investManager/listPage', getBody);
	}
	// 产品业务类型,修改(1)、续约(2)、终止(3)、开始运作(4)
	operationType(putBody, businessType) {
		delete putBody.sStatusZh;
		return this.httpClient.put('/pms/v1/oneOnOneFundInfo/oneOnOneBasicInfo?businessType=' + businessType, putBody);
	}
	// 判断产品审核状态,修改(1)、续约(2)、终止(3)、开始运作(4)
	checkProductStatus(nFundNo, sType) {
		return this.httpClient.get('/pms/v1/common/fundAudit/checkIsExit/' + nFundNo + '?sType=' + sType);
	}
	// 获取备案机构、受托人、托管人下拉框值
    getDictionary() {
        return this.httpClient.get('/pms/v1/common/dict/getStrustee?sFundType=3');
    }
}
